package appnode;

import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.EmbeddedOnly;
import com.google.appengine.api.datastore.Key;
import javax.jdo.annotations.Element;
import appnode.Messages;

@PersistenceCapable
public class Tablemsgs {

@PrimaryKey
@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
private Key key;

/*@PersistenceCapable
@EmbeddedOnly
public static class Messages {
	
	@Persistent
	private String content;
	
	@Persistent
	private Date date;
	
	public Messages(String content, Date date) {
		this.content = content;
		this.date = date;
	}
}*/

@Persistent
private String fromnode;

@Persistent
private String tonode;

@Persistent
private String subject;

@Persistent
private String status;

@Persistent
private Date createdday;

@Persistent
private Date update;

/*@Persistent
@Embedded
private Messages messages;*/

@Persistent(mappedBy="tablemsgs")
@Element(dependent="true")
private List<Messages> messages = new ArrayList<Messages>();


public Tablemsgs(String fromnode, String tonode, String subject, Date createdday, Date update) {
	this.fromnode = fromnode;
	this.tonode = tonode;
	this.subject = subject;
	this.status = status;
	this.createdday = createdday;
	this.update = update;
	
}

public Key getKey() {
	return key;
}

public String getFromnode() {
	return fromnode;
}

public String getTonode() {
	return tonode;
}

public String getSubject() {
	return subject;
}

public String getStatus() {
	return status;
}

public Date getCreatedday() {
	return createdday;
}

public Date getUpdate() {
	return update;
}

public List<Messages> getMessages() {
	return messages;
}

public void setKey(Key key) {
	this.key = key;
}

public void setFromnode(String fromnode) {
	this.fromnode = fromnode;
}

public void setTonode(String tonode) {
	this.tonode = tonode;
}

public void setSubject(String subject) {
	this.subject = subject;
}

public void setStatus(String status) {
	this.status = status;
}

public void setCreatedday(Date createdday) {
	this.createdday = createdday;
}

public void setUpdate(Date update) {
	this.update = update;
}


}